let a = [1, 2, 3, 4, 5];
console.log(a.slice(0, 3)); // [1,2,3]
console.log(a.slice(3)); // [4,5]
console.log(a.slice(1, -1)); // [2,3,4]
console.log(a.slice(-3, -1)); // [3,4]
console.log(a); // [1,2,3,4,5]
